﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Component;

public partial class BackEnd_LienHeList : System.Web.UI.UserControl
{

    public string _UrlModify = BackEndQuery._AdminQuery + BackEndQuery._LienHeM + "&" + ConstString._idcat + ConstString._dauBang;
    public string _Session = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        Load_Data();
    }
    private void Load_Data()
    {
        grid.DataKeyNames = new string[] { ColumLienHe._Id };
        grid.DataSource = LienHeDB.GetAll();
        grid.DataBind();

    }
    protected void grid_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        object id = grid.DataKeys[e.RowIndex].Value;
        LienHeInfo cat = LienHeDB.GetById(ConvertType.ToInt(id));
        if (LienHeDB.Delete(ConvertType.ToInt(id)))
            this.labMessage.Text = ConstString._xoaTC;
        else
            labMessage.Text = ConstString._xoaTB;
        Load_Data();
    }
}
    
